package com.lasun.server.entity;

import io.netty.channel.Channel;

public class Client {
	
	private Channel channel;
	
	private int index;
	
	private String username;
	
	public Client(Channel channel) {
		this.channel = channel;
	}
	
	public Channel getChannel() {
		return channel;
	}
	
	public int getId() {
		return index;
	}
	
	public void setId(int index) {
		this.index = index;
	}
	
	public void setUsername(String username) {
		this.username = username;
	}
	
	public String getUsername() {
		return username;
	}
	
	public void sendErrorMessage(String string) {
		this.getChannel().writeAndFlush(string);
	}
	
	public void sendChatMessage(String string) {
		this.getChannel().writeAndFlush(string);
	}
	
	public void sendClearChatArea() {
		this.getChannel().write("");
	}
	
}